Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8343336: Add persistentScrollBars preference #1618

Closed

Conversation

mstr2
Copy link
Collaborator

@mstr2 mstr2 commented Oct 31, 2024

This PR adds another accessibility preference that is available on all supported desktop platforms:

  1. Windows: Settings -> Accessibility -> Visual Effects -> Always show scroll bars
  2. macOS: System Settings -> Appearance -> Show scroll bars
  3. Ubuntu: Settings -> Accessibility -> Seeing -> Always show scroll bars

When the OS setting is changed, all platforms report updates that can be observed in JavaFX.
The manual test application test/manual/events/PlatformPreferencesChangedTest can be used to test the feature.

/reviewers 2
/csr


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8343451 to be approved
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issues

  • JDK-8343336: Add persistentScrollBars preference (Enhancement - P4)
  • JDK-8343451: Add persistentScrollBars preference (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1618/head:pull/1618
$ git checkout pull/1618

Update a local copy of the PR:
$ git checkout pull/1618
$ git pull https://git.openjdk.org/jfx.git pull/1618/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1618

View PR using the GUI difftool:
$ git pr show -t 1618

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1618.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 31, 2024

👋 Welcome back mstrauss! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 31, 2024

@mstr2 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8343336: Add persistentScrollBars preference

Reviewed-by: angorya, kcr

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 5 new commits pushed to the master branch:

  • 03eb8b1: 8344899: Map RT-nnnn bug IDs to JDK-mmmmmmm in JavaFX sources
  • bdfc338: 8338000: [macos] Remove GlassFullscreenWindow
  • a45e33c: 8342461: Remove calls to doPrivileged in javafx.web/{android,ios}
  • f7566ad: 8345063: Centralize version number of the Gradle build file
  • 4af67c1: 8344906: Simplify Java version parsing in the build file

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Ready for review label Oct 31, 2024
@openjdk
Copy link

openjdk bot commented Oct 31, 2024

@mstr2
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot added the csr Need approved CSR to integrate pull request label Oct 31, 2024
@openjdk
Copy link

openjdk bot commented Oct 31, 2024

@mstr2 has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@mstr2 please create a CSR request for issue JDK-8343336 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@mlbridge
Copy link

mlbridge bot commented Oct 31, 2024

Webrevs

@andy-goryachev-oracle
Copy link
Contributor

This looks like a useful data point.

I am curious as to what are the criteria for including or excluding a particular preference? What is our long term goal - should we support all the preferences available on a particular platform, or the intersection, or what? May be it's something to discuss first on the mailing list.

@mstr2
Copy link
Collaborator Author

mstr2 commented Oct 31, 2024

My thinking is that a particular preference should be useful and almost universally supported on the desktop platforms to make it into JavaFX API. The number of preferences we might consider are pretty limited, so I don't expect Platform.Preferences to explode in size and scope.

I think this is a minor addition that doesn't change anything substantial about Platform.Preferences, and as such doesn't need a major discussion since the arguments are basically the same since the introduction of platform preferences. However, if you or others are interested in having a discussion, we can of course do that.

@mstr2 mstr2 changed the title 8343336: Add reducedScrollBars preference 8343336: Add persistentScrollBars preference Oct 31, 2024
@mstr2
Copy link
Collaborator Author

mstr2 commented Oct 31, 2024

Changed the naming from reducedScrollBars to persistentScrollBars, as this matches the logic of the OS settings more closely.

@kevinrushforth
Copy link
Member

My thinking is that a particular preference should be useful and almost universally supported on the desktop platforms to make it into JavaFX API.

This seems like the right criteria to me.

The number of preferences we might consider are pretty limited, so I don't expect Platform.Preferences to explode in size and scope.

Good.

I think this is a minor addition that doesn't change anything substantial about Platform.Preferences, and as such doesn't need a major discussion since the arguments are basically the same since the introduction of platform preferences. However, if you or others are interested in having a discussion, we can of course do that.

With this explanation, I agree.

@kevinrushforth
Copy link
Member

Reviewers: @andy-goryachev-oracle @lukostyra

(I'll look over the public API and the CSR)

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code changes look good, and both the property and the key reflect the platform preference on macOS M1 14.7.

I'll test windows tomorrow, and if someone can test it on linux, that would be fantastic!

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good on win11, both property and windows key get updated in the monkey tester.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. In addition to reviewing the code and the docs, I tested it on all platforms. On Linux I tested it on Ubuntu 24.04 and on a very old 16.04. There is a minor bug on 16.04 (a warning printed), but it could be done as a follow-up if you prefer.

I reviewed the CSR, so it is ready to finalize.

@@ -121,6 +121,10 @@ jobject PlatformSupport::collectPreferences() const {
gboolean enableAnimations = true;
g_object_get(settings, "gtk-enable-animations", &enableAnimations, NULL);
putBoolean(env, prefs, "GTK.enable_animations", enableAnimations);

gboolean overlayScrolling = true;
g_object_get(settings, "gtk-overlay-scrolling", &overlayScrolling, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a warning to be printed during initialization on a very old Ubuntu system (16.04) when running any application:

GLib-GObject-WARNING **: g_object_get_valist: object class 'GtkSettings' has no property named 'gtk-overlay-scrolling'

I see from the docs that this setting was added in GTK 3.24.9. Perhaps a runtime check is in order? It could be done as a follow-up bug since it is just a warning. It correctly reports GTK.overlay_scrolling=true and persistentScrollBars=false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a runtime check for the gtk-overlay-scrolling property.

@openjdk openjdk bot removed the csr Need approved CSR to integrate pull request label Nov 26, 2024
Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning is gone on my Ubuntu 16.04 system. I note that the GTK.overlay_scrolling preference is not reported on that system (which seems fine) and that the persistentScrollBarsProperty is always false. Everything still works as expected on systems with a newer GTK.

@@ -121,6 +121,12 @@ jobject PlatformSupport::collectPreferences() const {
gboolean enableAnimations = true;
g_object_get(settings, "gtk-enable-animations", &enableAnimations, NULL);
putBoolean(env, prefs, "GTK.enable_animations", enableAnimations);

if (g_object_class_find_property(G_OBJECT_GET_CLASS(settings), "gtk-overlay-scrolling")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, presuming that we want the property to be absent on systems that don't support this setting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a property that isn't available shouldn't be included in the preferences map. We've documented that in Platform.Preferences:

     * The preferences that are reported by the platform may be dependent on the operating system version
     * and its current configuration, so applications should not assume that a particular preference is
     * always available.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so this is fine.

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ship it!

@openjdk openjdk bot added the ready Ready to be integrated label Dec 2, 2024
@mstr2
Copy link
Collaborator Author

mstr2 commented Dec 2, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Dec 2, 2024

Going to push as commit da6ad4b.
Since your change was applied there have been 5 commits pushed to the master branch:

  • 03eb8b1: 8344899: Map RT-nnnn bug IDs to JDK-mmmmmmm in JavaFX sources
  • bdfc338: 8338000: [macos] Remove GlassFullscreenWindow
  • a45e33c: 8342461: Remove calls to doPrivileged in javafx.web/{android,ios}
  • f7566ad: 8345063: Centralize version number of the Gradle build file
  • 4af67c1: 8344906: Simplify Java version parsing in the build file

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 2, 2024
@openjdk openjdk bot closed this Dec 2, 2024
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Dec 2, 2024
@openjdk
Copy link

openjdk bot commented Dec 2, 2024

@mstr2 Pushed as commit da6ad4b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants